package String;

public class StringTest {
    public static void main(String[] args) {
        String s1 = "Hello World";
        String s2 = "Hello World";
        String s3 = "World";
        System.out.println(s1 == s2);
        System.out.println(s1 == s3);
        String s4=new String("Hello World");
        System.out.println(s1 == s4);
        String s5="123456";
        String s="123";
        String str=s+"456";
        String str1="123"+"456";
        System.out.println(s5 == str1);
        System.out.println(s==str);
        System.out.println(str.equals(str1));
        System.out.println(s1.equals(s4));
    }
}
